Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distsql, executor: fix select channel bug that may discard error. #2226

Merged
merged 3 commits into from
Dec 12, 2016

Conversation

coocood
Copy link
Member

@coocood coocood commented Dec 12, 2016

When select receives two channels, both of them can return, which case will
be selected is undetermined.

Use one channel with resp and error to avoid this issue.

When select receives two channels, both of them can return, which case will
be selected is undetermined.

Use one channel with resp and error to avoid this issue.
@zimulala
Copy link
Contributor

LGTM

1 similar comment
@hanfei1991
Copy link
Member

LGTM

@coocood coocood merged commit fbffe27 into master Dec 12, 2016
@coocood coocood deleted the coocood/select-bug branch December 12, 2016 08:59
@@ -72,10 +72,13 @@ type selectResult struct {
resp kv.Response
ignoreData bool

results chan PartialResult
done chan error
results chan resultWithErr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I sugguest *resultWithErr...
use chan for value instead of ptr is heavy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants